<html>
<head><meta charset="utf-8"><title>lazy TAIT inference · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html">lazy TAIT inference</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="246981310"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246981310" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246981310">(Jul 23 2021 at 14:02)</a>:</h4>
<p>I'm doing some refactorings because the entire opaque type inference state was stored in FnCtxt and not InferCtxt, so we can't use it from InferCtxt (which is just a field of FnCtxt).</p>



<a name="246981326"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246981326" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246981326">(Jul 23 2021 at 14:02)</a>:</h4>
<p>yeah</p>



<a name="246981404"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246981404" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246981404">(Jul 23 2021 at 14:03)</a>:</h4>
<p>but it is looking like I can do the refactorings in nice small steps by re-using the existing eager infrastructure, but using it at the lazy points</p>



<a name="246981413"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246981413" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246981413">(Jul 23 2021 at 14:03)</a>:</h4>
<p>that makes sense</p>



<a name="246981438"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246981438" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246981438">(Jul 23 2021 at 14:03)</a>:</h4>
<p><span class="user-mention silent" data-user-id="124288">oli</span> <a href="#narrow/stream/144729-wg-traits/topic/lazy.20TAIT.20inference/near/246981404">said</a>:</p>
<blockquote>
<p>but it is looking like I can do the refactorings in nice small steps by re-using the existing eager infrastructure, but using it at the lazy points</p>
</blockquote>
<p>great!</p>



<a name="246981453"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246981453" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246981453">(Jul 23 2021 at 14:03)</a>:</h4>
<p>it's wasteful, as the existing stuff can handle a lot of cases that don't happen anymore, but we can clean that up afterwards</p>



<a name="246981474"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246981474" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246981474">(Jul 23 2021 at 14:03)</a>:</h4>
<p>cool</p>



<a name="246981497"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246981497" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246981497">(Jul 23 2021 at 14:04)</a>:</h4>
<p>One thing I was wondering is whether we should gate the lazy thing</p>



<a name="246981542"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246981542" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246981542">(Jul 23 2021 at 14:04)</a>:</h4>
<p>side note that next week I am hoping to use to focus primarily on reviews and some other similar things</p>



<a name="246981578"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246981578" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246981578">(Jul 23 2021 at 14:04)</a>:</h4>
<p>so hopefully any PRs will be promptly reviewed :)</p>



<a name="246981584"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246981584" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246981584">(Jul 23 2021 at 14:04)</a>:</h4>
<p><span class="user-mention silent" data-user-id="124288">oli</span> <a href="#narrow/stream/144729-wg-traits/topic/lazy.20TAIT.20inference/near/246981497">said</a>:</p>
<blockquote>
<p>One thing I was wondering is whether we should gate the lazy thing</p>
</blockquote>
<p>that's a good question</p>



<a name="246981600"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246981600" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246981600">(Jul 23 2021 at 14:04)</a>:</h4>
<p>I'm incliend to say no</p>



<a name="246981625"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246981625" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246981625">(Jul 23 2021 at 14:04)</a>:</h4>
<p>I'm debating whether it'll be observable to end users in any way</p>



<a name="246981633"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246981633" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246981633">(Jul 23 2021 at 14:04)</a>:</h4>
<p>I am too so far, but we'll see if there are any problems</p>



<a name="246981640"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246981640" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246981640">(Jul 23 2021 at 14:04)</a>:</h4>
<p>(I don't see how?)</p>



<a name="246981643"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246981643" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246981643">(Jul 23 2021 at 14:04)</a>:</h4>
<p>only via async if at all</p>



<a name="246981672"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246981672" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246981672">(Jul 23 2021 at 14:05)</a>:</h4>
<p>but I don't see how with async either</p>



<a name="246981691"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246981691" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246981691">(Jul 23 2021 at 14:05)</a>:</h4>
<p>I believe that in all stable cases existential impl Trait only appears in a fn return type</p>



<a name="246981703"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246981703" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246981703">(Jul 23 2021 at 14:05)</a>:</h4>
<p>and I don't <em>think</em> these refactorings affect that position</p>



<a name="246981740"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246981740" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246981740">(Jul 23 2021 at 14:05)</a>:</h4>
<p>well... they do affect the code that handles these, but the behaviour should be trivially equivalent</p>



<a name="246981746"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246981746" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246981746">(Jul 23 2021 at 14:05)</a>:</h4>
<p>since conceptually we are just kind of visiting the fn return type right away, so lazy and eager are kind of equivalent</p>



<a name="246981773"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246981773" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246981773">(Jul 23 2021 at 14:06)</a>:</h4>
<p>right, I meant in terms of user-observable behavior</p>



<a name="246981821"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246981821" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246981821">(Jul 23 2021 at 14:06)</a>:</h4>
<p>so in that way I'd rather not gate it</p>



<a name="246981829"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246981829" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246981829">(Jul 23 2021 at 14:06)</a>:</h4>
<p>because if there are interactions, I'd like to see them :)</p>



<a name="246981833"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246981833" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246981833">(Jul 23 2021 at 14:06)</a>:</h4>
<p>I was mainly worried that it may introduce user-observable behaviour</p>



<a name="246981852"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246981852" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246981852">(Jul 23 2021 at 14:06)</a>:</h4>
<p>I have to take some care around match arm unification</p>



<a name="246981856"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246981856" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246981856">(Jul 23 2021 at 14:06)</a>:</h4>
<p>but other than that, should be fine</p>



<a name="246981878"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246981878" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246981878">(Jul 23 2021 at 14:06)</a>:</h4>
<p><span class="user-mention silent" data-user-id="124288">oli</span> <a href="#narrow/stream/144729-wg-traits/topic/lazy.20TAIT.20inference/near/246981852">said</a>:</p>
<blockquote>
<p>I have to take some care around match arm unification</p>
</blockquote>
<p>there's some special magic code there that I'm trying to grok</p>



<a name="246981889"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246981889" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246981889">(Jul 23 2021 at 14:06)</a>:</h4>
<p>I hope it's just for diagnostics</p>



<a name="246981895"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246981895" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246981895">(Jul 23 2021 at 14:06)</a>:</h4>
<p>but it's not clear</p>



<a name="246982041"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246982041" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246982041">(Jul 23 2021 at 14:08)</a>:</h4>
<p>hmm, special code for <code>impl Trait</code> there?</p>



<a name="246982044"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246982044" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246982044">(Jul 23 2021 at 14:08)</a>:</h4>
<p>that's interesting</p>



<a name="246982070"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246982070" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246982070">(Jul 23 2021 at 14:08)</a>:</h4>
<p>I could imagine it being for diagnostics, that might be a common case where people try to return N types</p>



<a name="246982075"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246982075" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246982075">(Jul 23 2021 at 14:08)</a>:</h4>
<p>which reminds me</p>



<a name="246982098"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246982098" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246982098">(Jul 23 2021 at 14:08)</a>:</h4>
<p>that's a nice thing to cover in an "impl trait" vision doc :)</p>



<a name="246982123"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246982123" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246982123">(Jul 23 2021 at 14:08)</a>:</h4>
<p>yea, but I don't see how it can affect anything but diagnostics, so I think it's fine, still need to keep it working</p>



<a name="246982614"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246982614" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246982614">(Jul 23 2021 at 14:13)</a>:</h4>
<p>sounds good</p>



<a name="246986275"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246986275" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246986275">(Jul 23 2021 at 14:43)</a>:</h4>
<p>so... fun thing I just noticed, due to the way <code>rustc_infer</code> and <code>rustc_trait_selection</code> are split up, we can't "just" transform the eager system into a lazy one. We need to split out obligation registering on opaque types from the opaque type instantiation code</p>



<a name="246991838"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246991838" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246991838">(Jul 23 2021 at 15:27)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> how so?</p>



<a name="246991901"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246991901" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246991901">(Jul 23 2021 at 15:27)</a>:</h4>
<p>we could in principle convert the "resolve inference variables" to return obligations, I guess</p>



<a name="246991991"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246991991" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246991991">(Jul 23 2021 at 15:28)</a>:</h4>
<p>the other option I can imagine is that we accumulate the options in the inference context and have to remember to "take them out"</p>



<a name="246992002"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246992002" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246992002">(Jul 23 2021 at 15:28)</a>:</h4>
<p>I don't love that</p>



<a name="246993275"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246993275" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246993275">(Jul 23 2021 at 15:37)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/144729-wg-traits/topic/lazy.20TAIT.20inference/near/246991901">said</a>:</p>
<blockquote>
<p>we could in principle convert the "resolve inference variables" to return obligations, I guess</p>
</blockquote>
<p>it already does that</p>



<a name="246993406"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246993406" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246993406">(Jul 23 2021 at 15:38)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/144729-wg-traits/topic/lazy.20TAIT.20inference/near/246991991">said</a>:</p>
<blockquote>
<p>the other option I can imagine is that we accumulate the options in the inference context and have to remember to "take them out"</p>
</blockquote>
<p>I think we can just keep collecting the opaque types and then generate the obligations from that list</p>



<a name="246993452"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/lazy%20TAIT%20inference/near/246993452" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/lazy.20TAIT.20inference.html#246993452">(Jul 23 2021 at 15:38)</a>:</h4>
<p>we have to process these opaque types anyway for the <code>TypeckResults</code></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>